﻿using System.Windows;

namespace MvvmHelper
{
    /// <summary>
    /// System.Windows.DependencyPropertyChangedEventArgs の型安全版。
    /// </summary>
    /// <typeparam name="TProperty">プロパティの型</typeparam>
    public class DependencyPropertyChangedEventArgs<TProperty>
    {
        /// <summary>
        /// 依存プロパティ、古い値、新しい値を指定して初期化。
        /// </summary>
        /// <param name="property">依存プロパティ。</param>
        /// <param name="oldValue">古い値。</param>
        /// <param name="newValue">新しい値。</param>
        public DependencyPropertyChangedEventArgs(DependencyProperty property, TProperty oldValue, TProperty newValue)
        {
            this.Property = property;
            this.OldValue = oldValue;
            this.NewValue = newValue;
        }

        /// <summary>
        /// 依存プロパティ。
        /// </summary>
        public DependencyProperty Property { get; private set; }

        /// <summary>
        /// 古い値。
        /// </summary>
        public TProperty OldValue { get; private set; }

        /// <summary>
        /// 新しい値。
        /// </summary>
        public TProperty NewValue { get; private set; }
    }
}
